<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<title>悦章科技机构平台</title>
<script src="/Public/static/jquery-2.0.3.min.js"></script>
<script src="/Public/static/layer/layer.js"></script>
<!--内容样式-->
<link rel="stylesheet" href="__PUBLIC__/Home/css/style.css" />

</head>

<body>

	
	<div class="login-box">
	
		<div class="lb-nr">
			<h3>欢迎来到<br>悦章科技机构平台</h3>
			<form class="lbn-bd">
				<div class="lbnb-zd">账号/用户名</div>
				<input type="text" placeholder="请输入帐号" class="mobile">
				<div class="lbnb-zd">登录密码</div>
				<input type="password" placeholder="请输入密码" class="password">
				<a onclick="login()" class="lbnb-btn">登录</a>
			</form>
		</div>
		
		<div class="lb-bq">COPYRIGHT © 2020 悦章科技版权所有  湘ICP备 2312414-号</div>
	
	</div>
	
	
	
</body>

<script>
    function login(){
        var mobile = $('.mobile').val();
        var password = $('.password').val();

        var url = "{:U('confirm_login')}";
        $.ajax({
            type: "POST", //类型get，post
            url: url, //链接地址
            data:{"mobile":mobile,"password":password},//参数，一般post用
            success: function(data){
                var dataObj = JSON.parse(data);
                //成功后函数
                if(dataObj.result == 1){
                    setTimeout(function (){
                        window.location.href = "{:U('Home/Index/index')}";
                    },1000);
                }else{
                    layer.msg(dataObj.msg);
                }
            },
            error:function(){
                //失败时函数
                layer.msg("失败");
            }
        })
    }

    $(document).keyup(function(event){
        if(event.keyCode==13){
            login();
        }
    });
</script>
</html>
